﻿using Microsoft.EntityFrameworkCore;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Domain.Models
{
    [DisplayName("地址")]
    [Owned]
    public class Address
    {
        [DisplayName("国家")]
        public virtual Country Country { get; set; } = new Country();

        [DisplayName("省份")]
        [StringLength(25)]
        public string Province { get; set; }

        [DisplayName("城市")]
        [StringLength(25)]
        public string City { get; set; }

        [DisplayName("区域")]
        [StringLength(500)]
        public string Region { get; set; }

        [DisplayName("街道")]
        [StringLength(500)]
        public string Street { get; set; }

        [DisplayName("详细地址")]
        [StringLength(1024)]
        public string DetailAddress { get; set; }
        public override string ToString() => $"{Country} {Province} {City} {Street}";
    }
}
